﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/AdminIndexMaster.master" AutoEventWireup="true" CodeFile="Admin_ShopInvoiceView.aspx.cs" Inherits="Admin_Admin_ShopInvoiceView" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<table class="adminheading">
   <tr>
      <th valign="middle" class="menus" align="left">订单管理</th>
      <td align="right">
      <div style="width:400px">
            <a href="Admin_ShopTradeOrder.aspx" >交易记录管理</a>&nbsp;|&nbsp;
            <a href="Admin_ShopSendOrderView.aspx?add=1">发退货管理</a>&nbsp;|&nbsp;
            <a href="Admin_ShopInvoiceView.aspx">开发票记录管理</a>&nbsp;|&nbsp;
            <a href="Admin_ShopPayInfoView.aspx">订单支付记录</a>&nbsp;<br />                
      </div>
      </td> 
      <td class="rtdw"></td>          
   </tr>                     
</table>

       <table class="nick">
        <tr>
            <td class="ltd">卖家名称：</td>
            <td class="rtd" style="width:35%">
                <asp:TextBox ID="txtSalername" runat="server" AutoPostBack="True" 
                    OnTextChanged="txtSalername_TextChanged" /></td>
            <td class="ltd">用户列表：</td>
            <td class="rtd" style="width:35%">
                <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True"
                            DataTextField="username" DataValueField="userid" AppendDataBoundItems="True">
                    <asp:ListItem Selected="True" Value="-1">所有</asp:ListItem>
                        </asp:DropDownList>
                <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" SelectMethod="GetUserLikeUserName"
                    TypeName="HKB.Web.UserBll">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="txtSalername" Name="UserName" PropertyName="Text" Type="String" />
                    </SelectParameters>
                </asp:ObjectDataSource>
            </td>
        </tr>
        <tr>
            <td class="ltd">客户名称：</td>
            <td class="rtd" style="width:35%"><asp:TextBox ID="TxtUserName" runat="server" AutoPostBack="True"/></td>
            <td class="ltd">发票类型：</td>
            <td class="rtd" style="width:35%">
                <asp:DropDownList ID="DropInvoiceType" runat="server" AutoPostBack="True">
                   <asp:ListItem Value="-1" Text="所有" Selected="true"/>
                   <asp:ListItem Value="0" Text="地税普通发票"/>
                   <asp:ListItem Value="1" Text="国税普通发票"/>
                   <asp:ListItem Value="2" Text="增值税发票"/>
                </asp:DropDownList></td>
        </tr>
        <tr>
            <td class="ltd">起始日期：</td>
            <td class="rtd" style="width:35%">
                <asp:TextBox ID="TxtBeginDate" runat="server" AutoPostBack="True" />               
            </td>
            <td class="ltd">结束日期：</td>
            <td class="rtd" style="width:35%">
                <asp:TextBox ID="TxtEndDate" runat="server" AutoPostBack="True" />                
            </td>
        </tr>
    </table>

            <asp:GridView ID="GridView2" class="adminlist" runat="server" AutoGenerateColumns="False" DataSourceID="ObjectDataSource1"
                OnDataBound="GridView2_DataBound" OnRowDataBound="GridView2_RowDataBound" AllowPaging="True" PageSize="15">
                <Columns>
                    <asp:HyperLinkField HeaderText="客户" DataNavigateUrlFields="UserID" DataNavigateUrlFormatString="Admin_UserDetail.aspx?UserID={0}"
                       DataTextField="UserName" />                    
                    <asp:BoundField DataField="InvoiceDate" HeaderText="日期"　>
                        <HeaderStyle Width="8%" />                       
                    </asp:BoundField>
                    <asp:BoundField DataField="InvoiceType" HeaderText="发票类型"　 >
                        <HeaderStyle Width="11%" />                     
                    </asp:BoundField>
                    <asp:BoundField DataField="InvoiceNum" HeaderText="发票号码"　 >
                        <HeaderStyle Width="10%" />                     
                    </asp:BoundField>
                    <asp:BoundField DataField="Invoicetitle" HeaderText="发票抬头"　>
                        <HeaderStyle Width="10%" />                      
                    </asp:BoundField>
                    <asp:HyperLinkField 
                        DataTextField="OrderFormNum" HeaderText="订单号">
                        <HeaderStyle Width="12%" />                        
                    </asp:HyperLinkField>
                    <asp:BoundField DataField="Drawer" HeaderText="开票人"　>
                        <HeaderStyle Width="8%" />                         
                    </asp:BoundField>
                    <asp:BoundField DataField="Inputer" HeaderText="录入员"　>
                        <HeaderStyle Width="8%" />                        
                    </asp:BoundField>
                    <asp:BoundField DataField="totalmoney" HeaderText="发票金额"　>
                        <HeaderStyle Width="8%" />                      
                    </asp:BoundField>
                    <asp:BoundField DataField="InputTime" HeaderText="录入时间"　>
                        <HeaderStyle Width="8%" />                     
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="操作" >
                      <ItemTemplate>
                        <asp:LinkButton ID="cl" runat="server" OnClientClick="if(confirm('确定删除吗？'))return true; return false;" OnCommand="Delete_ButtonOnClick" CommandName='<%# Eval("InvoiceID") %>' Text="删除" />
                      </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <EmptyDataTemplate>
                        <tr>
                            <th>客户</th>
                            <th>日期</th>
                            <th>发票类型</th>
                            <th>发票号码</th>
                            <th>发票抬头</th>
                            <th>订单号</th>
                            <th>开票人</th>
                            <th>录入员</th>
                            <th>发票金额</th>
                            <th>录入时间</th>
                            <th>操作</th>
                        </tr>
                        <tr><td colspan="11">暂无信息！</td></tr>
                </EmptyDataTemplate>
            </asp:GridView>
    <table class="adminlist"></table>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetInvoiceBySalerIDUserNameBegindateEndDate"
        TypeName="HKB.Web.Shop_InvoiceItem" DeleteMethod="DeleteInvoice">
        <SelectParameters>
            <asp:ControlParameter ControlID="DropDownList1" DefaultValue="-1" Name="SalerID"
                PropertyName="SelectedValue" Type="Int32" />
            <asp:ControlParameter ControlID="TxtUserName" DefaultValue="" Name="UserName" PropertyName="Text"
                Type="String" />
            <asp:ControlParameter ControlID="TxtBeginDate" DefaultValue="2006-01-01" Name="BeginDate"
                PropertyName="Text" Type="String" />
            <asp:ControlParameter ControlID="TxtEndDate" DefaultValue="2500-01-01" Name="EndDate"
                PropertyName="Text" Type="String" />
            <asp:ControlParameter ControlID="DropInvoiceType" DefaultValue="-1" Name="InvoiceType"
                PropertyName="SelectedValue" Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
   
</asp:Content>

